<?php
session_start();

require_once 'include/s.php';

if (!isset($_SERVER['PHP_AUTH_USER']) || !isset($_SERVER['PHP_AUTH_PW']) || !isset($_SESSION["login"])) {
    header('WWW-Authenticate: Basic realm="kimbs auth"');
    header('HTTP/1.0 401 Unauthorized');
    $_SESSION["login"] = true;
    echo "Access Denied. [<a href='" . $_SERVER['PHP_SELF'] . "'>Login</a>]";
    exit;
} else {
    if ($_SERVER['PHP_AUTH_USER'] == AUTH_USER && $_SERVER['PHP_AUTH_PW'] == AUTH_PW) {
    } else {
        unset($_SESSION["login"]);
        header("Location: " . $_SERVER['PHP_SELF']);
        exit;
    }
}

?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title><?php echo $_SERVER['SERVER_NAME']; ?> - <?php echo t(); ?></title>
    <meta name="Robots" content="noindex,nofollow" />
    <meta http-equiv="pragma" content="no-cache" />
    <link href="/favicon.ico" rel="SHORTCUT ICON" type="image/x-icon" />

    <link rel="stylesheet" href="<?php echo CSS_HOST . 'style.css'; ?>" type="text/css" media="all" />
</head>
<body>
    <div id="main">
        <?php include_once 'view/admin_inc_header.php'; ?>
        <div id="central">
            <?php echo c(); ?>
        </div>
        <?php include_once 'view/admin_inc_right.php'; ?>
        <?php include_once 'view/inc_footer.php'; ?>
    </div>
</body>

<script type="text/javascript" src="<?php echo JS_HOST . 'general.js'; ?>"></script>
<?php k_bottomJs(); ?>

</html>